<template>
  <a-layout id="components-layout-demo-side" style="min-height: 100vh">
    <a-layout-sider
      collapsible
      v-model="collapsed"
      :trigger="null"
      width="256px"
    >
      <div class="mylogo">
        <h1>
          <img src="@/assets/svg/logo.svg" alt="logo" width="32" height="32" />
          Good Base System
        </h1>
      </div>
      <side-menu />
    </a-layout-sider>
    <a-layout>
      <a-layout-header style="background: #fff; padding: 0">
        <a-icon
          class="trigger"
          :type="collapsed ? 'menu-unfold' : 'menu-fold'"
          @click="collapsed = !collapsed"
        ></a-icon>
        <Header />
      </a-layout-header>
      <a-layout-content style="margin: 0 16px">
        <div
          :style="{
            margin: '16px',
            padding: '24px',
            background: '#fff',
            minHeight: '360px'
          }"
        >
          <router-view />
        </div>
      </a-layout-content>
      <a-layout-footer style="text-align: center">
        <Footer />
      </a-layout-footer>
    </a-layout>
  </a-layout>
</template>

<script>
import Footer from "@/components/layout/Footer";
import SideMenu from "@/components/layout/SideMenu";
import Header from "@/components/layout/Header";

export default {
  name: "Layout",
  data() {
    return {
      collapsed: false
    };
  },
  components: {
    Header,
    Footer,
    SideMenu
  }
};
</script>

<style scoped>
#components-layout-demo-side .logo {
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  margin: 16px;
}
.trigger {
  padding: 0 20px;
  line-height: 64px;
  font-size: 20px;
}

.trigger:hover {
  background: #eeeeee;
}

.mylogo {
  position: relative;
  height: 64px;
  padding-left: 24px;
  overflow: hidden;
  line-height: 64px;
  background: #002140;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
}

.mylogo h1 {
  color: #fff;
  font-size: 18px;
  font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
  font-weight: 600;
  vertical-align: middle;
}
</style>
